<?php
class UserAction extends CommentAction
{
	public function deleteUser() {
		$this->checkAdmin();
		$user_id = $_GET['user_id'];
		$user_dao = M('user');
		$condition['id'] = $user_id;
		$user_dao->where($condition)->delete();
		$this->ajaxReturn(null,null,1);
	}
	
	public function personalPage() {
		$group_dao = new GroupModel();
		$groups = $group_dao->getByUserId($_SESSION['user']['id']);
		
		$friend_dao = new FriendModel();
		$friends = $friend_dao->getFriendsByUserId($_SESSION['user']['id']);
		
		$note_dao = new NoteModel();
		$notes = $note_dao->getByUserId($_SESSION['user']['id']);
		
		$this->assign("groups", $groups);
		$this->assign("friends", $friends);
		$this->assign("notes", $notes);
		$this->display();
	}
}

?>